home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / AIIe / TN.AIIE.003 < prev    next >
Encoding:
Text File  |  1990-01-23  |  61.9 KB  |  1,262 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Apple IIe
  8. #3:    Double High-Resolution Graphics
  9.  
  10. Revised by:    Matt Deatherage, Glenn A. Baxter & Cameron Birse November 1988
  11. Written by:    Peter Baum                                      September 1983
  12.  
  13. This Technical Note is a tutorial on double high-resolution (hi-res) graphics, 
  14. a feature available on 128K Apple IIe, IIc, and IIGS computers.
  15. _____________________________________________________________________________
  16.  
  17.  
  18. Introduction
  19.  
  20. This Note was originally written in the early days of double high-resolution 
  21. graphics.  At that time, there was no Apple IIc or IIGS, therefore, some of 
  22. the things originally said may seem a little strange today, five years later.
  23.  
  24. For example, this Note talks a fair amount about being sure that you have a 
  25. Revision B Apple IIe with the jumper installed.  All Apple IIe computers 
  26. shipped since about mid-1983 have a Revision B motherboard, so this is not 
  27. that big a concern anymore; furthermore, nearly every IIe out there has the 
  28. aforementioned jumper already installed (it is not even an option on some 
  29. third-party 80-column cards for the IIe).
  30.  
  31. Also, the IIc and IIGS are functionally equivalent (for the purposes of this 
  32. article) to a Revision B IIe with the properly-jumpered 80-column card 
  33. installed, and most of the references made to the Apple IIe apply equally to 
  34. the IIc and IIGS.  We have tried to update most of the references to avoid 
  35. confusion.
  36.  
  37. Considering the myriad of programming utilities, games, graphics programs, and 
  38. other software that now uses double high-resolution graphics, it is probable 
  39. that this Note will not be as vital as it once was.  If you are writing in 
  40. AppleSoft BASIC, you will probably find it easier to purchase a commercial 
  41. double hi-res BASIC utility package to add double hi-res commands to 
  42. AppleSoft, rather than writing your own routines.  Similarly, those who want 
  43. double hi-res art will find a double hi-res art application much easier than 
  44. trying to draw it from the monitor or machine language.
  45.  
  46. However, if you have the insatiable curiosity about these things that Apple II 
  47. owners and developers so often are blessed (cursed?) with, this Note will show 
  48. you how double high-resolution works, as well as giving a few type-along 
  49. examples in the monitor to get your feet wet.
  50.  
  51. This article describes the double high-resolution display mode which is 
  52. available in the Apple IIc, IIGS, and the Apple IIe (with an extended 80-
  53. column card).  Double hi-res graphics provides twice the horizontal resolution 
  54. and more colors than the standard high-resolution mode.  On a monochrome 
  55. monitor, double hi-res displays 560 horizontal by 192 vertical pixels, while 
  56. on a color monitor, it allows the use of 16 colors.
  57.  
  58.  
  59. Double High-Resolution on the Apple II Series
  60.  
  61. What is It?
  62.  
  63. The double high-resolution display mode that is available for the Apple IIe 
  64. provides twice the horizontal resolution of the standard high-resolution mode.  
  65. On a standard black-and-white video monitor, standard hi-res displays 280 
  66. columns and 192 rows of picture elements (pixels); the double hi-res mode 
  67. displays 560 x 192 pixels.  On a color monitor, the standard hi-res mode 
  68. displays up to 140 columns of colors, each color being selected from the group 
  69. of six colors available, with certain limitations.  Double hi-res displays 140 
  70. columns of color, for which all 16 of the low-resolution colors are available.
  71.  
  72.                                Black/White          Color
  73.                  Standard    280 x 192 pixels    140 columns
  74.                  Hi-Res                          6 colors
  75.  
  76.                  Double      560 x 192 pixels    140 columns
  77.                  Hi-Res                          16 colors
  78.  
  79.          Table 1-Comparison of Standard and Double Hi-Res Graphics
  80.  
  81. How Do I Install It?
  82.  
  83. Installation of the double hi-res mode on your Apple IIe depends on the 
  84. following three conditions, discussed in detail below:
  85.  
  86. 1.    Presence of a Revision B motherboard
  87. 2.    Installation of an extended 80-column text card with jumper
  88. 3.    A video monitor with a bandwidth of at least 14 MHz
  89.  
  90. First, your Apple IIe must have a Revision B (Rev-B) motherboard.  To find out 
  91. whether your computer's motherboard is a Rev-B, check the part number on the 
  92. edge of the board nearest the back panel, above the slots.  If the board is a 
  93. Rev-B, the part number will be 820-0064-B.  (Double hi-res does not work on 
  94. systems containing a Rev-A motherboard.)  If your computer's motherboard is 
  95. not a Rev-B, and if you want to obtain one, contact your local Apple dealer.
  96.  
  97. The second condition for installing double hi-res on your IIe is that it must 
  98. have an extended 80-column text card installed.  This card must be installed 
  99. with a jumper connecting the two Molex-type pins on the board.
  100.  
  101. Warning:    If your IIe has a Rev-A motherboard, do not use an extended 
  102. 80-column card with the jumper connection mentioned above; 
  103. the system will not work at all if you do.
  104.  
  105. The last requirement for operation in double hi-res mode is that your video 
  106. monitor must have a bandwidth of at least 14 MHz.  This bandwidth is necessary 
  107. because a television set that requires a modulator will not reproduce some 
  108. characters or graphic elements clearly, due to the high speed at which the 
  109. computer sends out dots in this mode.  Because most of the video monitors 
  110. having a bandwidth of up to 14 MHz are black-and-white, the working examples 
  111. in this article do not apply to color monitors.  If you have a video monitor, 
  112. please use it--instead of a television set--to display the following examples.  
  113. The AppleColor composite monitors will work just fine.
  114.  
  115.  
  116. Your Turn to be Creative (Volunteers, Anyone?)
  117.  
  118. The tutorial that occupies the rest of this Note assumes you are working at 
  119. your Apple II as you read.  The second part of the lesson demonstrates the 
  120. double hi-res mode; therefore, before embarking on the second part, you should 
  121. install a jumpered extended 80-column card in your Rev-B Apple IIe (or use any 
  122. Apple IIc or IIGS).
  123.  
  124.  
  125. Hands-On Practice with Standard Hi-Res
  126.  
  127. The Apple II hi-res graphics display is bit-mapped.  In other words, each dot 
  128. on the screen corresponds to a bit in the computer's memory.  For a real-life 
  129. example of bit-mapping, perform the following procedure, according to the 
  130. instructions given below.  (The symbol <cr> indicates a carriage return.)
  131.  
  132. 1.    Boot the system.
  133. 2.    Engage the Caps Lock key, and type HGR<cr>.  (This instruction 
  134.       should clear the top of the screen.)
  135. 3.    Type CALL -151 <cr>.  (The system is now in the monitor mode, and 
  136.       the prompt should appear as an asterisk (*).)
  137. 4.    Type 2100:1 <cr>.  One single dot should appear in the upper left-
  138.       hand corner of the screen.
  139.  
  140. Congratulations!  You have just plotted your first hi-res pixel.  (Not an 
  141. astonishing feat, but you have to start somewhere.)
  142.  
  143. With a black-and-white monitor, the bits in memory have a simple 
  144. correspondence with the dots (pixels) on the screen.  A dot of light appears 
  145. if the corresponding bit is set (has a value of 1), but remains invisible if 
  146. the bit is off (has a value of zero).  (The dot appears white on a black-and-
  147. white monitor, and green on a green-screen monitor, such as Apple's Monitor 
  148. /// or Monitor II.  For simplicity, we shall refer to an invisible dot as a 
  149. black dot or pixel.)  Two visible dots located next to each other appear as a 
  150. single wide dot, and many adjacent dots appear as a line.  To obtain a display 
  151. of another dot and a line, follow the steps listed below:
  152.  
  153. 1.    Type 2080:40 <cr>.  A dot should appear above and to the right of 
  154.       the dot you produced in the last exercise.
  155. 2.    Type 2180:7F <cr>.  A small horizontal line should appear below 
  156.       the first dot you produced.
  157.  
  158. From Bits and Bytes to Pixels
  159.  
  160. The seven low-order bits in each display byte control seven adjacent dots in a 
  161. row.  A group of 40 consecutive bytes in memory controls a row of 280 dots (7 
  162. dots per byte, multiplied by 40 bytes).  In the screen display, the least-
  163. significant bit of each byte appears as the leftmost pixel in a group of 7 
  164. pixels.  The second least-significant bit corresponds to the pixel directly to 
  165. the right of the pixel previously displayed, and so on.  To watch this 
  166. procedure in action, follow the steps listed below.  The dots will appear in 
  167. the middle of your screen.
  168.  
  169.  
  170. 1.    Type 2028:1 <cr>.
  171. 2.    Type 2828:2 <cr>.
  172. 3.    Type 3028:4 <cr>.
  173.  
  174. The three bits you specified in this exercise correspond to three pixels that 
  175. are displayed one after another, from left to right.
  176.  
  177. The most-significant bit in each byte does not correspond to a pixel.  
  178. Instead, this bit is used to shift the positions of the other seven bits in 
  179. the byte.  For a demonstration of this feature, follow the steps listed below:
  180.  
  181. 1.    Type 2050:8 <cr>.
  182. 2.    Type 2850:8 <cr>.
  183. 3.    Type 3050:8 <cr>.
  184.  
  185. You will notice that the dots align themselves vertically.  Now do the 
  186. following:
  187.  
  188. 4.    Type 2450:88 <cr>.
  189.  
  190. The new dot (that is, the one that corresponds to the bit you just specified) 
  191. does not line up with the dots you displayed earlier.  Instead, it appears to 
  192. be shifted one "half-dot" to the right.
  193.  
  194. 5.    To demonstrate that this dot really is a new dot, and not just the old 
  195.       dot shifted by one dot position, type 2050:18 <cr>, 2850:18 <cr>.
  196.  
  197. You will notice that the dot mentioned under step 4 (the dot that was not 
  198. aligned with the other seven dots) is straddled by the dots above and below 
  199. it.  (The use of magnifying lenses is permitted.)
  200.  
  201. Shifting the pixel one half-dot, by setting the high, most-significant bit is 
  202. most often used for color displays.  When the high bit of a byte is set to 
  203. generate this shifted dot (which is also called the half-dot shift), then all 
  204. the dots for that byte will be shifted one half dot.  The half-dot shift does 
  205. not exist in the double hi-res mode.
  206.  
  207. The Figure 1 shows the memory map for the standard hi-res graphics mode.
  208.  
  209.                              Horizontal Offset
  210.      Base | $00 | $01 | $02 | $03         $24 | $25 | $26 | $27 |
  211.      _____|_____|_____|_____|_____       _____|_____|_____|_____|
  212.      $2000|     |     |     |     |     |     |     |     |     |
  213.      $2080|     |     |     |     |     |     |     |     |     |
  214.      $2100|     |     |     |     |     |     |     |     |     |
  215.      $2180|     |     |     |     |     |     |     |     |     |
  216.      $2200|     |     |     |     |     |     |     |     |     |
  217.      $2280|     |     |     |     |     |     |     |     |     |
  218.      $2300|     |     |     |     |     |     |     |     |     |
  219.      $2380|     |     |     |     |     |     |     |     |     |
  220.      $2028|     |     |     |      \     \    |     |     |     |
  221.      $20A8|     |     |     |       \     \   |     |     |     |
  222.      $2128|     |     |     |       /     /   |     |     |     |
  223.      $21A8|     |     |     |      /     /    |     |     |     |
  224.      $2228|     |     |     |     /     /     |     |     |     |
  225.      $22A8|     |     |     |    /     /      |     |     |     |
  226.      $2328|     |     |     |   /     /       |     |     |     |
  227.      $23A8|     |     |     |   \     \       |     |     |     |
  228.      $2050|     |     |     |    \     \      |     |     |     |
  229.      $20D0|     |     |     |     |     |     |     |     |     |
  230.      $2150|     |     |     |     |     |     |     |     |     |
  231.      $21D0|     |     |     |     |     |     |     |     |     |
  232.      $2250|     |     |     |     |     |     |     |     |     |
  233.      $22D0|     |     |     |     |     |     |     |     |     |
  234.      $2350|     |     |     |     |     |     |     |     |     |
  235.      $23D0|     |     |     |     |     |     |     |     |     |
  236.  
  237.                  Figure 1 - Standard Hi-Res Memory Map
  238.  
  239. Note: This memory map is in Chapter 2 of the Apple IIe Technical Reference,
  240.       First Printing, January 1987.
  241.  
  242. Figure 2 shows the box subdivisions for the memory map in Figure 1.
  243.  
  244.                Offset              Bit
  245.                from                            LSB
  246.                base   | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  247.                _______|___|___|___|___|___|___|___|
  248.                +$0000 |   |   |   |   |   |   |   |
  249.                +$0400 |   |   |   |   |   |   |   |
  250.                +$0800 |   |   |   |   |   |   |   |
  251.                +$0C00 |   |   |   |   |   |   |   |
  252.                +$1000 |   |   |   |   |   |   |   |
  253.                +$1400 |   |   |   |   |   |   |   |
  254.                +$1800 |   |   |   |   |   |   |   |
  255.                +$1C00 |   |   |   |   |   |   |   |
  256.  
  257.         Figure 2 - Box Subdivisions of the Standard Memory Map
  258.         
  259. Note: This figure is the inset of the hi-res graphics display map in
  260.       Chapter 2 of the Apple IIe Technical Reference, First Printing, January 1987.
  261.  
  262. For example, the first memory address of each screen line for the first few 
  263. lines is as follows:
  264.  
  265. $2000, $2400, $2800, $2C00, $3000, $3400, $3800, $3C00, $2080, $2480, etc.
  266.  
  267. Each of the 24 boxes contains 8 screen lines for a total of 192 vertical lines 
  268. per screen.  Each of the  40 boxes per line contains 7 pixels for a total of 
  269. 280 pixels horizontally across each line.
  270.  
  271.  
  272. The Intricacies of Double Hi-Res
  273.  
  274. Because the double high-resolution graphics mode provides twice the horizontal 
  275. dot density as standard hi-res graphics does, double hi-res requires twice as 
  276. much memory as does standard hi-res.  If you spent many hours committing the 
  277. standard hi-res memory map to memory, don't despair; double hi-res still uses 
  278. the hi-res graphics page (but only to represent half the picture, so to 
  279. speak).  In the double hi-res mode, the hi-res graphics page is compressed to 
  280. fit into half of the display.  The other half of the display is stored in 
  281. memory (called the auxiliary (aux) memory) on the extended 80-column card.  
  282. (This article refers to the standard hi-res graphics page, which resides in 
  283. main memory, as the motherboard (main) memory.)
  284.  
  285. The auxiliary memory uses the same addresses used by the standard hi-res 
  286. graphics page (page 1, $2000 through $3FFF).  The hi-res graphics page stored 
  287. in auxiliary memory is known as hi-res page 1X.  The graphics pages in 
  288. auxiliary memory are bank-switched memory, which you can switch in by 
  289. activating some of the soft switches.  (Adventurous readers may want to skip 
  290. ahead to Using the Auxiliary Memory, which appears later in this Note.)
  291.  
  292. The memory mapping for the hi-res graphics display is analogous to the 
  293. technique used for the 80-column display.  The double hi-res display 
  294. interleaves bytes from the two different memory pages (auxiliary and 
  295. motherboard).  Seven bits from a byte in the auxiliary memory bank are 
  296. displayed first, followed by seven bits from the corresponding byte on the 
  297. motherboard.  The bits are shifted out the same way as in standard hi-res 
  298. (least-significant bit first).  In double hi-res, the most significant bit of 
  299. each byte is ignored; thus, no half-dot shift can occur.  (This feature is 
  300. important, as you will see when we examine double hi-res in color.)
  301.  
  302. The memory map for double hi-res appears in Figure 3.
  303.  
  304.                         Horizontal Offset
  305.        $00   $01   $02   $03         $24   $25   $26   $27
  306.          M     M     M     M           M     M     M     M 
  307.       A  a  A  a  A  a  A  a        A  a  A  a  A  a  A  a
  308.      |u  i |u  i |u  i |u  i        u  i |u  i |u  i |u  i |
  309. Base |x |n |x |n |x |n |x |n        x |n |x |n |x |n |x |n |
  310. _____|__|__|__|__|__|__|__|__       __|__|__|__|__|__|__|__|
  311. $2000|     |     |     |     |     |     |     |     |     |
  312. $2080|     |     |     |     |     |     |     |     |     |
  313. $2100|     |     |     |     |     |     |     |     |     |
  314. $2180|     |     |     |     |     |     |     |     |     |
  315. $2200|     |     |     |     |     |     |     |     |     |
  316. $2280|     |     |     |     |     |     |     |     |     |
  317. $2300|     |     |     |     |     |     |     |     |     |
  318. $2380|     |     |     |     |     |     |     |     |     |
  319. $2028|     |     |     |      \     \    |     |     |     |
  320. $20A8|     |     |     |       \     \   |     |     |     |
  321. $2128|     |     |     |       /     /   |     |     |     |
  322. $21A8|     |     |     |      /     /    |     |     |     |
  323. $2228|     |     |     |     /     /     |     |     |     |
  324. $22A8|     |     |     |    /     /      |     |     |     |
  325. $2328|     |     |     |   /     /       |     |     |     |
  326. $23A8|     |     |     |   \     \       |     |     |     |
  327. $2050|     |     |     |    \     \      |     |     |     |
  328. $20D0|     |     |     |     |     |     |     |     |     |
  329. $2150|     |     |     |     |     |     |     |     |     |
  330. $21D0|     |     |     |     |     |     |     |     |     |
  331. $2250|     |     |     |     |     |     |     |     |     |
  332. $22D0|     |     |     |     |     |     |     |     |     |
  333. $2350|     |     |     |     |     |     |     |     |     |
  334. $23D0|     |     |     |     |     |     |     |     |     |
  335.  
  336.             Figure 3 - Double Hi-Res Memory Map
  337.  
  338. Note: This memory map is in Chapter 2 of the Apple IIe Technical Reference,
  339.       First Printing, January 1987.
  340.  
  341. Each box is subdivided exactly the same way it is in the standard hi-res mode.
  342.  
  343.  
  344. Obtaining a Double-Hi-Res Display
  345.  
  346. To display the double hi-res mode, set the following soft switches:
  347.  
  348.                        In the monitor    In AppleSoft
  349.                        Read              PEEK
  350.              HI-RES    $C057             49239
  351.              GR        $C050             49232
  352.              AN3       $C05E             49246
  353.              MIXED     $C053             49235
  354.  
  355.                        In the monitor    In AppleSoft
  356.                        Write             POKE
  357.              80COL     $C00D             49165,0
  358.  
  359. Annunciator 3 (AN3) must be turned off to get into double hi-res mode.  You 
  360. turn it off by reading location 49246 ($C05E).  Note that whenever you press 
  361. Control-Reset, AN3 is turned on; therefore, each time you press Control-Reset, 
  362. you must turn AN3 off again.
  363.  
  364. If you are using MIXED mode, then the bottom four lines on the screen will 
  365. display text.  If you have not turned on the 80-column card, then every second 
  366. character in the bottom four lines of text will be a random character.  (The 
  367. reason is that although the hardware displays 80 columns of characters, the 
  368. firmware only updates the 40-column screen, which consists of the characters 
  369. in the odd-numbered columns.  The characters in even-numbered columns then 
  370. consist of random characters taken from text page 1X in the auxiliary memory.)
  371.  
  372. To remove the even characters from the bottom four lines on the screen, type 
  373. PR#3<CR> from AppleSoft (type 3^P in the monitor).  This procedure clears the 
  374. memory locations on page 1X.
  375.  
  376.  
  377. Using the Auxiliary Memory
  378.  
  379. The auxiliary memory consists of several different sections, which you can 
  380. select by using the soft switches listed below.  A pair of memory locations is 
  381. dedicated to each switch.  (One location turns the switch on; the other turns 
  382. it off.)  You activate a switch by writing to the appropriate memory location.  
  383. The write instruction itself is what activates the switch; therefore, it does 
  384. not matter what data you write to the memory location.  The soft switches are 
  385. as follows:
  386.  
  387.                             In the monitor    In AppleSoft
  388.                             Write             POKE
  389.           80STORE    off    $C000             49152,0
  390.                      on     $C001             49153,0
  391.           RAMRD      off    $C002             49154,0
  392.                      on     $C003             49155,0
  393.           RAMWRT     off    $C004             49156,0
  394.                      on     $C005             49157,0
  395.           PAGE2      off    $C054             49236,0
  396.                      on     $C055             49237,0
  397.           HIRES      off    $C056             49238,0
  398.                      on     $C057             49239,0
  399.  
  400. A routine called AUXMOVE ($C311), located in the 80-column firmware, is also 
  401. very handy, as we will see below.
  402.  
  403. Accessing memory on the auxiliary card with the soft switches has the 
  404. following characteristics.  Memory maps, which help clarify the descriptions, 
  405. are in Figures 4, 5, and 6.
  406.  
  407. 1.    To activate the PAGE2 and HIRES switches, you need only read 
  408.       (PEEK) from the corresponding memory locations (instead of writing 
  409.       to them, as you do for the other three switches).
  410. 2.    The PAGE2 switch normally selects the display page, in either 
  411.       graphics or text mode, from either page 1 or page 2 of the 
  412.       motherboard memory.  However, it does so only when the 80STORE 
  413.       switch is off.
  414. 3.    If the 80STORE switch is on, then the function of the PAGE2 switch 
  415.       changes.  When 80STORE is on, then PAGE2 switches in the text 
  416.       page, locations $400-7FF, from auxiliary memory (text page 1X), 
  417.       instead of switching the display screen to the alternate video 
  418.       page (page 2 on the motherboard).  When 80STORE is on, the PAGE2 
  419.       switch determines which memory bank (auxiliary or motherboard) is 
  420.       used during any access to addresses $400 through 7FF.  When the 
  421.       80STORE switch is on, it has priority over all other switches.
  422. 4.    If the 80STORE switch is on, then the PAGE2 switch only switches 
  423.       in the graphics page 1X from the auxiliary memory if the HIRES 
  424.       switch is also on.  (Note that this circumstance is slightly 
  425.       different from that described in item 3.)  When 80STORE is on, and 
  426.       if the HIRES switch is also on, then the PAGE2 switch selects the 
  427.       memory bank (auxiliary or motherboard) for accesses to a memory 
  428.       location within the range $2000 through 3FFF.  If the HIRES switch 
  429.       is off, then any access to an memory location within the range 
  430.       $2000 through 3FFF uses the motherboard memory, regardless of the 
  431.       state of the PAGE2 switch.
  432. 5.    If the 80STORE switch is off, and if the RAMRD and RAMWRT switches 
  433.       are on, then any reading from or writing to address space $200-
  434.       $BFFF gains access to the auxiliary memory.  If only one of the 
  435.       switches, RAMRD, for example, is set, then only the appropriate 
  436.       operation (in this case a read) will be performed on the auxiliary 
  437.       memory.  If only RAMWRT is set, then all write operations access 
  438.       the auxiliary memory.  When the 80STORE switch is on, it has 
  439.       higher priority than the RAMRD and RAMWRT switches.
  440.  
  441.        Main Memory                     Auxiliary Memory
  442.        ___________  _________________  ___________ 
  443. $FFFF |///////////|                   |           |
  444.       |///Bank////|                   |   Bank    |
  445.       |/Switched//|                   | Switched  |
  446.       |//Memory///|                   |  Memory   |
  447.       |///////////|                   |           |
  448.       |___________|___________  _____ |___________|___________ 
  449. $DFFF |///////////|///////////|       |           |           |
  450.       |//Bank 1///|//Bank 2///|       |  Bank 1   |  Bank 2   |
  451. $D000 |///////////|///////////|       |           |           |
  452.       |___________|___________| _____ |___________|___________|
  453.        ___________  _________________  ___________ 
  454. $BFFF |///////////|                   |           |
  455.       |///////////|                   |           |
  456.       |///////////|                   |           |
  457.       |///////////|                   |           |
  458.       |///////////|                   |           |
  459.       |___________| _________________ |___________|
  460. $5FFF |///////////|                   |           |
  461.       |//Hi-Res///|                   |  Hi-Res   |
  462.       |/Graphics//|                   | Graphics  |
  463.       |//Page 2///|                   |  Page 2X  |
  464. $4000 |///////////|                   |           |
  465.       |___________| _________________ |___________|
  466. $3FFF |///////////|                   |           |
  467.       |//Hi-Res///|                   |  Hi-Res   |
  468.       |/Graphics//|                   | Graphics  |
  469.       |//Page 1///|                   |  Page 1X  |
  470. $2000 |///////////|                   |           |
  471.       |___________| _________________ |___________|
  472.       |///////////|                   |           |
  473.       |///////////|                   |           |
  474.       |///////////|                   |           |
  475.       |___________| _________________ |___________|
  476. $0BFF |///////////|                   |           |
  477.       |///Text////|                   |   Text    |
  478.       |//Page 2///|                   |  Page 2X  |
  479. $0800 |///////////|                   |           |
  480.       |___________| _________________ |___________|
  481. $07FF |///////////|                   |           |
  482.       |///Text////|                   |   Text    |
  483.       |//Page 1///|                   |  Page 1X  |
  484. $0400 |///////////|                   |           |
  485.       |___________| _________________ |___________|
  486.       |///////////|                   |           |
  487.       |///////////|                   |           |
  488.       |///////////|                   |           |
  489.       |___________| _________________ |___________|
  490. $01FF |///////////|                   |           |
  491.       |/Stack and/|                   | Alternate |
  492.       |/Zero Page/|                   | Stack and |
  493.       |///////////|                   | Zero Page |
  494. $0000 |///////////|                   |           |
  495.       |___________| _________________ |___________|
  496.  
  497.  __________________________    ______
  498. | 80STORE      | OFF | ON  |  |//////|
  499. |______________|_____|_____|  |//////|
  500. | PAGE2        |  X  | OFF |  |//////|
  501. |______________|_____|_____|  |______|
  502. | HIRES        |  X  |  X  |   Active
  503. |______________|_____|_____|   Memory
  504. | RAMRD/RAMWRT | OFF | OFF |
  505. |______________|_____|_____|
  506.  
  507.                     Figure 4A - Memory Map One-A
  508.  
  509.        Main Memory                     Auxiliary Memory
  510.        ___________  _________________  ___________ 
  511. $FFFF |///////////|                   |           |
  512.       |///Bank////|                   |   Bank    |
  513.       |/Switched//|                   | Switched  |
  514.       |//Memory///|                   |  Memory   |
  515.       |///////////|                   |           |
  516.       |___________|___________  _____ |___________|___________ 
  517. $DFFF |///////////|///////////|       |           |           |
  518.       |//Bank 1///|//Bank 2///|       |  Bank 1   |  Bank 2   |
  519. $D000 |///////////|///////////|       |           |           |
  520.       |___________|___________| _____ |___________|___________|
  521.        ___________  _________________  ___________ 
  522. $BFFF |           |                   |///////////|
  523.       |           |                   |///////////|
  524.       |           |                   |///////////|
  525.       |           |                   |///////////|
  526.       |           |                   |///////////|
  527.       |___________| _________________ |___________|
  528. $5FFF |           |                   |///////////|
  529.       |  Hi-Res   |                   |//Hi-Res///|
  530.       | Graphics  |                   |/Graphics//|
  531.       |  Page 2   |                   |//Page 2X//|
  532. $4000 |           |                   |///////////|
  533.       |___________| _________________ |___________|
  534. $3FFF |           |                   |///////////|
  535.       |  Hi-Res   |                   |//Hi-Res///|
  536.       | Graphics  |                   |/Graphics//|
  537.       |  Page 1   |                   |//Page 1X//|
  538. $2000 |           |                   |///////////|
  539.       |___________| _________________ |___________|
  540.       |           |                   |///////////|
  541.       |           |                   |///////////|
  542.       |           |                   |///////////|
  543.       |___________| _________________ |___________|
  544. $0BFF |           |                   |///////////|
  545.       |   Text    |                   |///Text////|
  546.       |  Page 2   |                   |//Page 2X//|
  547. $0800 |           |                   |///////////|
  548.       |___________| _________________ |___________|
  549. $07FF |           |                   |///////////|
  550.       |   Text    |                   |///Text////|
  551.       |  Page 1   |                   |//Page 1X//|
  552. $0400 |           |                   |///////////|
  553.       |___________| _________________ |___________|
  554.       |           |                   |///////////|
  555.       |           |                   |///////////|
  556.       |           |                   |///////////|
  557.       |___________| _________________ |___________|
  558. $01FF |///////////|                   |           |
  559.       |/Stack and/|                   | Alternate |
  560.       |/Zero Page/|                   | Stack and |
  561.       |///////////|                   | Zero Page |
  562. $0000 |///////////|                   |           |
  563.       |___________| _________________ |___________|
  564.  
  565.  __________________________    ______
  566. | 80STORE      | OFF | ON  |  |//////|
  567. |______________|_____|_____|  |//////|
  568. | PAGE2        |  X  | ON  |  |//////|
  569. |______________|_____|_____|  |______|
  570. | HIRES        |  X  |  X  |   Active
  571. |______________|_____|_____|   Memory
  572. | RAMRD/RAMWRT | ON  | ON  |
  573. |______________|_____|_____|
  574.  
  575.                     Figure 4B - Memory Map One-B
  576.  
  577.        Main Memory                     Auxiliary Memory
  578.        ___________  _________________  ___________ 
  579. $FFFF |///////////|                   |           |
  580.       |///Bank////|                   |   Bank    |
  581.       |/Switched//|                   | Switched  |
  582.       |//Memory///|                   |  Memory   |
  583.       |///////////|                   |           |
  584.       |___________|___________  _____ |___________|___________ 
  585. $DFFF |///////////|///////////|       |           |           |
  586.       |//Bank 1///|//Bank 2///|       |  Bank 1   |  Bank 2   |
  587. $D000 |///////////|///////////|       |           |           |
  588.       |___________|___________| _____ |___________|___________|
  589.        ___________  _________________  ___________ 
  590. $BFFF |///////////|                   |           |
  591.       |///////////|                   |           |
  592.       |///////////|                   |           |
  593.       |///////////|                   |           |
  594.       |///////////|                   |           |
  595.       |___________| _________________ |___________|
  596. $5FFF |///////////|                   |           |
  597.       |//Hi-Res///|                   |  Hi-Res   |
  598.       |/Graphics//|                   | Graphics  |
  599.       |//Page 2///|                   |  Page 2X  |
  600. $4000 |///////////|                   |           |
  601.       |___________| _________________ |___________|
  602. $3FFF |///////////|                   |           |
  603.       |//Hi-Res///|                   |  Hi-Res   |
  604.       |/Graphics//|                   | Graphics  |
  605.       |//Page 1///|                   |  Page 1X  |
  606. $2000 |///////////|                   |           |
  607.       |___________| _________________ |___________|
  608.       |///////////|                   |           |
  609.       |///////////|                   |           |
  610.       |///////////|                   |           |
  611.       |___________| _________________ |___________|
  612. $0BFF |///////////|                   |           |
  613.       |///Text////|                   |   Text    |
  614.       |//Page 2///|                   |  Page 2X  |
  615. $0800 |///////////|                   |           |
  616.       |___________| _________________ |___________|
  617. $07FF |           |                   |///////////|
  618.       |   Text    |                   |///Text////|
  619.       |  Page 1   |                   |//Page 1X//|
  620. $0400 |           |                   |///////////|
  621.       |___________| _________________ |___________|
  622.       |///////////|                   |           |
  623.       |///////////|                   |           |
  624.       |///////////|                   |           |
  625.       |___________| _________________ |___________|
  626. $01FF |///////////|                   |           |
  627.       |/Stack and/|                   | Alternate |
  628.       |/Zero Page/|                   | Stack and |
  629.       |///////////|                   | Zero Page |
  630. $0000 |///////////|                   |           |
  631.       |___________| _________________ |___________|
  632.  
  633.  __________________________    ______
  634. | 80STORE      | ON  |     |  |//////|
  635. |______________|_____|_____|  |//////|
  636. | PAGE2        | ON  |     |  |//////|
  637. |______________|_____|_____|  |______|
  638. | HIRES        | OFF |     |   Active
  639. |______________|_____|_____|   Memory
  640. | RAMRD/RAMWRT | OFF |     |
  641. |______________|_____|_____|
  642.  
  643.                   Figure 5A - Memory Map Two-A
  644.                     
  645.        Main Memory                     Auxiliary Memory
  646.        ___________  _________________  ___________ 
  647. $FFFF |///////////|                   |           |
  648.       |///Bank////|                   |   Bank    |
  649.       |/Switched//|                   | Switched  |
  650.       |//Memory///|                   |  Memory   |
  651.       |///////////|                   |           |
  652.       |___________|___________  _____ |___________|___________ 
  653. $DFFF |///////////|///////////|       |           |           |
  654.       |//Bank 1///|//Bank 2///|       |  Bank 1   |  Bank 2   |
  655. $D000 |///////////|///////////|       |           |           |
  656.       |___________|___________| _____ |___________|___________|
  657.        ___________  _________________  ___________ 
  658. $BFFF |///////////|                   |           |
  659.       |///////////|                   |           |
  660.       |///////////|                   |           |
  661.       |///////////|                   |           |
  662.       |///////////|                   |           |
  663.       |___________| _________________ |___________|
  664. $5FFF |///////////|                   |           |
  665.       |//Hi-Res///|                   |  Hi-Res   |
  666.       |/Graphics//|                   | Graphics  |
  667.       |//Page 2///|                   |  Page 2X  |
  668. $4000 |///////////|                   |           |
  669.       |___________| _________________ |___________|
  670. $3FFF |           |                   |///////////|
  671.       |  Hi-Res   |                   |//Hi-Res///|
  672.       | Graphics  |                   |/Graphics//|
  673.       |  Page 1   |                   |//Page 1X//|
  674. $2000 |           |                   |///////////|
  675.       |___________| _________________ |___________|
  676.       |///////////|                   |           |
  677.       |///////////|                   |           |
  678.       |///////////|                   |           |
  679.       |___________| _________________ |___________|
  680. $0BFF |///////////|                   |           |
  681.       |///Text////|                   |   Text    |
  682.       |//Page 2///|                   |  Page 2X  |
  683. $0800 |///////////|                   |           |
  684.       |___________| _________________ |___________|
  685. $07FF |           |                   |///////////|
  686.       |   Text    |                   |///Text////|
  687.       |  Page 1   |                   |//Page 1X//|
  688. $0400 |           |                   |///////////|
  689.       |___________| _________________ |___________|
  690.       |///////////|                   |           |
  691.       |///////////|                   |           |
  692.       |///////////|                   |           |
  693.       |___________| _________________ |___________|
  694. $01FF |///////////|                   |           |
  695.       |/Stack and/|                   | Alternate |
  696.       |/Zero Page/|                   | Stack and |
  697.       |///////////|                   | Zero Page |
  698. $0000 |///////////|                   |           |
  699.       |___________| _________________ |___________|
  700.  
  701.  __________________________    ______
  702. | 80STORE      | ON  |     |  |//////|
  703. |______________|_____|_____|  |//////|
  704. | PAGE2        | ON  |     |  |//////|
  705. |______________|_____|_____|  |______|
  706. | HIRES        | ON  |     |   Active
  707. |______________|_____|_____|   Memory
  708. | RAMRD/RAMWRT | OFF |     |
  709. |______________|_____|_____|
  710.  
  711.                     Figure 5B - Memory Map Two-B
  712.  
  713.        Main Memory                     Auxiliary Memory
  714.        ___________  _________________  ___________ 
  715. $FFFF |///////////|                   |           |
  716.       |///Bank////|                   |   Bank    |
  717.       |/Switched//|                   | Switched  |
  718.       |//Memory///|                   |  Memory   |
  719.       |///////////|                   |           |
  720.       |___________|___________  _____ |___________|___________ 
  721. $DFFF |///////////|///////////|       |           |           |
  722.       |//Bank 1///|//Bank 2///|       |  Bank 1   |  Bank 2   |
  723. $D000 |///////////|///////////|       |           |           |
  724.       |___________|___________| _____ |___________|___________|
  725.        ___________  _________________  ___________ 
  726. $BFFF |           |                   |///////////|
  727.       |           |                   |///////////|
  728.       |           |                   |///////////|
  729.       |           |                   |///////////|
  730.       |           |                   |///////////|
  731.       |___________| _________________ |___________|
  732. $5FFF |           |                   |///////////|
  733.       |  Hi-Res   |                   |//Hi-Res///|
  734.       | Graphics  |                   |/Graphics//|
  735.       |  Page 2   |                   |//Page 2X//|
  736. $4000 |           |                   |///////////|
  737.       |___________| _________________ |___________|
  738. $3FFF |           |                   |///////////|
  739.       |  Hi-Res   |                   |//Hi-Res///|
  740.       | Graphics  |                   |/Graphics//|
  741.       |  Page 1   |                   |//Page 1X//|
  742. $2000 |           |                   |///////////|
  743.       |___________| _________________ |___________|
  744.       |           |                   |///////////|
  745.       |           |                   |///////////|
  746.       |           |                   |///////////|
  747.       |___________| _________________ |___________|
  748. $0BFF |           |                   |///////////|
  749.       |   Text    |                   |///Text////|
  750.       |  Page 2   |                   |//Page 2X//|
  751. $0800 |           |                   |///////////|
  752.       |___________| _________________ |___________|
  753. $07FF |///////////|                   |           |
  754.       |///Text////|                   |   Text    |
  755.       |//Page 1///|                   |  Page 1X  |
  756. $0400 |///////////|                   |           |
  757.       |___________| _________________ |___________|
  758.       |           |                   |///////////|
  759.       |           |                   |///////////|
  760.       |           |                   |///////////|
  761.       |___________| _________________ |___________|
  762. $01FF |///////////|                   |           |
  763.       |/Stack and/|                   | Alternate |
  764.       |/Zero Page/|                   | Stack and |
  765.       |///////////|                   | Zero Page |
  766. $0000 |///////////|                   |           |
  767.       |___________| _________________ |___________|
  768.  
  769.  __________________________    ______
  770. | 80STORE      | ON  |     |  |//////|
  771. |______________|_____|_____|  |//////|
  772. | PAGE2        | OFF |     |  |//////|
  773. |______________|_____|_____|  |______|
  774. | HIRES        | OFF |     |   Active
  775. |______________|_____|_____|   Memory
  776. | RAMRD/RAMWRT | ON  |     |
  777. |______________|_____|_____|
  778.  
  779.                  Figure 6A - Memory Map Three-A
  780.  
  781.        Main Memory                     Auxiliary Memory
  782.        ___________  _________________  ___________ 
  783. $FFFF |///////////|                   |           |
  784.       |///Bank////|                   |   Bank    |
  785.       |/Switched//|                   | Switched  |
  786.       |//Memory///|                   |  Memory   |
  787.       |///////////|                   |           |
  788.       |___________|___________  _____ |___________|___________ 
  789. $DFFF |///////////|///////////|       |           |           |
  790.       |//Bank 1///|//Bank 2///|       |  Bank 1   |  Bank 2   |
  791. $D000 |///////////|///////////|       |           |           |
  792.       |___________|___________| _____ |___________|___________|
  793.        ___________  _________________  ___________ 
  794. $BFFF |           |                   |///////////|
  795.       |           |                   |///////////|
  796.       |           |                   |///////////|
  797.       |           |                   |///////////|
  798.       |           |                   |///////////|
  799.       |___________| _________________ |___________|
  800. $5FFF |           |                   |///////////|
  801.       |  Hi-Res   |                   |//Hi-Res///|
  802.       | Graphics  |                   |/Graphics//|
  803.       |  Page 2   |                   |//Page 2X//|
  804. $4000 |           |                   |///////////|
  805.       |___________| _________________ |___________|
  806. $3FFF |///////////|                   |           |
  807.       |//Hi-Res///|                   |  Hi-Res   |
  808.       |/Graphics//|                   | Graphics  |
  809.       |//Page 1///|                   |  Page 1X  |
  810. $2000 |///////////|                   |           |
  811.       |___________| _________________ |___________|
  812.       |           |                   |///////////|
  813.       |           |                   |///////////|
  814.       |           |                   |///////////|
  815.       |___________| _________________ |___________|
  816. $0BFF |           |                   |///////////|
  817.       |   Text    |                   |///Text////|
  818.       |  Page 2   |                   |//Page 2X//|
  819. $0800 |           |                   |///////////|
  820.       |___________| _________________ |___________|
  821. $07FF |///////////|                   |           |
  822.       |///Text////|                   |   Text    |
  823.       |//Page 1///|                   |  Page 1X  |
  824. $0400 |///////////|                   |           |
  825.       |___________| _________________ |___________|
  826.       |           |                   |///////////|
  827.       |           |                   |///////////|
  828.       |           |                   |///////////|
  829.       |___________| _________________ |___________|
  830. $01FF |///////////|                   |           |
  831.       |/Stack and/|                   | Alternate |
  832.       |/Zero Page/|                   | Stack and |
  833.       |///////////|                   | Zero Page |
  834. $0000 |///////////|                   |           |
  835.       |___________| _________________ |___________|
  836.  
  837.  __________________________    ______
  838. | 80STORE      | ON  |     |  |//////|
  839. |______________|_____|_____|  |//////|
  840. | PAGE2        | OFF |     |  |//////|
  841. |______________|_____|_____|  |______|
  842. | HIRES        | ON  |     |   Active
  843. |______________|_____|_____|   Memory
  844. | RAMRD/RAMWRT | ON  |     |
  845. |______________|_____|_____|
  846.  
  847.                         Figure 6B - Memory Map Three-B
  848.  
  849.  
  850. Shortcuts:  Writing to Auxiliary Memory from the Keyboard
  851.  
  852. Press Control-Reset, then type CALL -151 <cr> (to enter the monitor).  Now 
  853. type the following hexadecimal addresses to turn on the double hi-res mode:
  854.  
  855.      C057      (for hi-res)
  856.      C050      (for graphics)
  857.      C053      (for mixed mode)
  858.      C05E      Turns off AN3 for double hi-res
  859.      C00D:0    Turns on the 80COL switch
  860.  
  861. This procedure usually causes the display of a random dot pattern at the top 
  862. of the screen, while the bottom four lines on the screen contain text.  To 
  863. clear the screen, follow the steps listed below:
  864.  
  865. 1.    Type 3D0G <cr> to return to BASIC.
  866. 2.    Type HGR <cr> to clear half of the screen.  (The characters you 
  867.       type will probably appear in alternating columns.  This is not a 
  868.       cause for alarm; as noted above, the firmware simply thinks you 
  869.       are working with a 40-column display.)  Remember that hi-res 
  870.       graphics commands do not know about the half of the screen stored 
  871.       on page 1X in the auxiliary memory.  Therefore, only page 1 (that 
  872.       is, the first half) of the graphics page on the motherboard is 
  873.       cleared.  As a result, in the the screen display, only alternate 
  874.       7-bit columns appear cleared.
  875.  
  876.       On the other hand, if all of the screen columns were cleared after 
  877.       the HGR command, then chances are good that you are not in double 
  878.       hi-res mode.  If your screen was cleared then to determine which 
  879.       mode you are in, type the following instructions:
  880.  
  881.            CALL -151
  882.            2000:FF
  883.            2001<2000.2027M
  884.  
  885.       If a solid line appears across the top of the screen, you are not 
  886.       in double hi-res mode.  (The line that appears should be a dashed 
  887.       or intermittent line:  - - - - - across the screen.)  If you are 
  888.       not in double hi-res mode, then make sure that you do have a Rev. 
  889.       B motherboard, and that the two Molex-type pins on the extended 
  890.       80-column card are shorted together with the jumper block.  Then 
  891.       re-enter the instructions listed above.
  892.  
  893. If you are staring at a half-cleared screen, you can clear the non-blank 
  894. columns by writing zeros to addresses $2000 through $3FFF on graphics page 1X 
  895. of auxiliary memory.  To do so, simply turn on the 80STORE switch, turn on the 
  896. PAGE2 switch, then write to locations $2000, $2001, $2002, and so on up 
  897. through $3FFF.  However, this procedure will not work if you try it from the 
  898. monitor.  The reason is that each time you invoke a monitor routine, the 
  899. routine sets the PAGE2 switch back to page 1 so that it can display the most 
  900. recent command that you entered.  When you try to write to $2000, etc. on the 
  901. auxiliary card, instead it will write to the motherboard memory.
  902.  
  903. Another way to obtain the desired result is to use the monitor's USER command, 
  904. which forces a jump to memory location $3F8.  You can place a JMP instruction 
  905. starting at this memory location, so the program will jump to a routine that 
  906. writes into hi-res page 1X.  Fortunately, the system already contains such a 
  907. routine:  AUXMOVE.
  908.  
  909.  
  910. Using AUXMOVE
  911.  
  912. You use the AUXMOVE routine to move data blocks between main and auxiliary 
  913. memory, but the task still remains of setting up the routine so that it knows 
  914. which data to write, and where to write it.  To use this routine, some byte 
  915. pairs in the zero page must be setup with the data block addresses, and the 
  916. carry bit must be fixed to indicate the direction of the move.  You may not be 
  917. surprised to learn that the byte pairs in the zero page used by AUXMOVE are 
  918. also the scratch-pad registers used by the monitor during instruction 
  919. execution.  The result is that while you type the addresses for the monitor's 
  920. move command, those addresses are being stored in the byte pairs used by 
  921. AUXMOVE.  Thereafter, you can call the AUXMOVE command directly, using the 
  922. USER (Control-Y) command.
  923.  
  924. In practice, then, enter the following instructions:
  925.  
  926.      C00A:0               (turns on the 80-column ROM, which 
  927.                           contains the AUXMOVE routine)
  928.      C000:0               (reason explained below)
  929.      3F8: 4C 11 C3        (the jump to AUXMOVE)
  930.      2000<2000.3FFF ^Y    (where ^Y indicates that you should type 
  931.                           Control-Y)
  932.  
  933. The syntax for this USER (Control-Y) command is:
  934.  
  935.                     {AUXdest}<{MBstart}.{MBend}^Y
  936.  
  937. The command copies the values in the range MBstart to MBend in the motherboard 
  938. memory into the auxiliary memory beginning at AUXdest.  This command is 
  939. analogous to the MOVE command.
  940.  
  941. You can use this procedure to transfer any block of data from the motherboard 
  942. memory to hi-res page 1X.  Working directly from the keyboard, you can use a 
  943. data block transferred this way to fill in any part of a double hi-res screen 
  944. image.  The image to be stored in hi-res page 1X (i.e., the image that will be 
  945. displayed in the even-numbered columns of the double hi-res picture) must 
  946. first be stored in the motherboard memory.  You can then use the Control-Y 
  947. command to transfer the image to hi-res page 1X.
  948.  
  949. The AUXMOVE routine uses the RAMRD and RAMWRT switches to transfer the data 
  950. blocks.  Because the 80STORE switch overrides the RAMRD and RAMWRT switches, 
  951. the 80STORE switch must be turned off--otherwise it would keep the transfer 
  952. from occurring properly (hence the write to $C000 above).
  953.  
  954. If the 80STORE and HIRES switches are on and PAGE2 is off, when you execute 
  955. AUXMOVE, any access to an address located within the range from $2000 to $3FFF 
  956. inclusive would use the motherboard memory, regardless of how RAMRD and RAMWRT 
  957. are set.  Entering the command C000:0 <cr> turns off 80STORE, thus letting the 
  958. RAMRD and RAMWRT switches control the memory banking.
  959.  
  960. The Control-Y trick described above only works for transferring data blocks 
  961. from the main (motherboard) memory to auxiliary memory (because the monitor 
  962. always enters the AUXMOVE routine with the carry bit set).  To move data 
  963. blocks from the auxiliary memory to the main memory, you must enter AUXMOVE 
  964. with the carry bit clear.  You can use the following routine to transfer data 
  965. blocks in either direction:
  966.  
  967.      301:AD 0 3      (loads the contents of address $300 into the 
  968.                      accumulator)
  969.      304:2A          (rotates the most-significant bit into the carry 
  970.                      flag)
  971.      305:4C 11 C3    (jump to $C311 (AUXMOVE))
  972.      3F8:4C 1 3      (sets the Control-Y command to jump to address 
  973.                      $301)
  974.  
  975. Before using this routine, you must modify memory location $300, depending on 
  976. the direction in which you want to transfer the data blocks.  If the transfer 
  977. is from the auxiliary memory to the motherboard, you must clear location $300 
  978. to zero.  If the transfer is from the motherboard to the auxiliary memory, you 
  979. must set location $300 to $FF.
  980.  
  981.  
  982. Two Double Hi-Res Pages
  983.  
  984. So far, we have only discussed using graphics pages 1 and 1X to display double 
  985. hi-res pictures.  But--analogous to the standard hi-res pages 1 and 2--two 
  986. double hi-res pages exist:  pages 1 and 1X, at locations $2000 through 3FFF, 
  987. and pages 2 and 2X, at locations $4000 through 5FFF.  The only trick in 
  988. displaying the second double hi-res page is that you must turn off the 80STORE 
  989. switch.  If the 80STORE switch is on, then only the first page (1 and 1X) is 
  990. displayed.  Go ahead and try it:
  991.  
  992.      C000:0    to turn off the 80STORE switch
  993.      C055      to turn on the PAGE2 switch
  994.  
  995. The screen will fill with another display of random bits.  Clear the screen 
  996. using the instructions listed above (in the Using AUXMOVE section ).  However, 
  997. this time, use addresses $4000 through 5FFF instead.  (Don't be alarmed by the 
  998. fact that the figures you are typing are not displayed on the screen.  They 
  999. are being "displayed" on text page 1.)
  1000.  
  1001.      4000:0
  1002.      4001<4000.5FFFM
  1003.      4000<4000.5FFF ^Y
  1004.  
  1005. You will be delighted to learn that you can also use this trick to display two 
  1006. 80-column text screens.  The only problem here is that the 80-column firmware 
  1007. continually turns on the 80STORE switch, which prevents the display of the 
  1008. second 80-column screen.  However, if you write your own 80-column display 
  1009. driver, then you can use both of the 80-column screens.
  1010.  
  1011.  
  1012. Color Madness
  1013.  
  1014. It should come as no surprise that color-display techniques in double hires 
  1015. are different from color-display techniques in standard hi-res.  This 
  1016. difference is because the half-dot shift does not exist in double hi-res mode.
  1017.  
  1018. Instead of going into a dissertation on how a television set decodes and 
  1019. displays a color signal, I'll simply explain how to generate color in double 
  1020. hi-res mode.  In the following examples, the term color monitor refers to 
  1021. either an NTSC monitor or a color television set.  Both work; however, the 
  1022. displays will be much harder to see on the color television.  The generation 
  1023. of color in double hi-res demands sacrifices.  A 560 x 192 dot display is not 
  1024. possible in color.  Instead, the horizontal resolution decreases by a factor 
  1025. of four (140 dots across the screen).  Just as with a black-and-white monitor, 
  1026. a simple correspondence exists between memory and the pixels on the screen.  
  1027. The difference is that four bits are required to determine each color pixel.  
  1028. These four bits represent 16 different combinations:  one for each of the 
  1029. colors available in double hi-res.  (These are the same colors that are 
  1030. available in the low-resolution mode.)
  1031.  
  1032. Let's start by exploring the pattern that must be stored in memory to draw a 
  1033. single colored line across the screen.  Use a color demonstration program 
  1034. (such as COLOR.TEST from older DOS 3.3 System Master disks) to adjust the 
  1035. colors displayed by your monitor.  After you have adjusted the colors, exit 
  1036. from the color demonstration program.
  1037.  
  1038. The instructions that appear below are divided into groups separated by blank 
  1039. lines.  Because it is very difficult (and, on a television set, almost 
  1040. impossible) to read the characters you are typing as they appear on the 
  1041. screen, you will probably make typing errors.  If the instructions appear not 
  1042. to work, then start again from the beginning of a group of instructions.
  1043.  
  1044.      CALL -151           (to get into the monitor routine/program)
  1045.      C050                (This set of instructions puts the computer
  1046.      CO57                into double hi-res model.
  1047.      C05E
  1048.      C00D:0
  1049.      2000:0              (This set of instructions clears first one half
  1050.      2001<2000.3FFFM     of the screen, and then the other half of
  1051.      3F8: 4C 11 C3       the screen.)
  1052.      2000<2000.3FFF^Y
  1053.  
  1054.      2100:11 4           (Two red dots appear on top left of 
  1055.                          screen)
  1056.      2102<2100.2126M     (A dashed red line appears across screen)
  1057.  
  1058.      2150:8 22           (Two green dots appear near bottom left)
  1059.      2152<2150.2175M     (Dashed green line appears across screen)
  1060.  
  1061.      2100<2150.2177^Y    (Fills in the red line)
  1062.  
  1063. In contrast to conditions in standard hi-res, no half-dot shift occurs, and 
  1064. the most-significant bit of each byte is not used.
  1065.  
  1066. As noted above, four bits determine a color.  You can paint a one-color line 
  1067. across the screen simply by repeating a four-bit pattern across the screen, 
  1068. but it is much easier to write a whole byte rather than just change four bits 
  1069. at a time.  Since only seven bits of each byte are displayed (as noted earlier 
  1070. in our discussion of black-and-white double hi-res) and the pattern is four 
  1071. bits wide, it repeats itself every 28 bits or four bytes.  Use the 
  1072. instructions listed below to draw a line of any color across the screen by 
  1073. repeating a four byte pattern for the color as shown in Table 2.
  1074.  
  1075.      2200: main1 main2   (Colored dots appear at the left edge)
  1076.      2202<2200.2226M     (A dashed, colored line appears)
  1077.  
  1078.      2250: aux1 aux2
  1079.      2250<2250.2276M
  1080.  
  1081.      2200<2250.2276^Y    (Fills in line, using the selected color)
  1082.  
  1083.                                                 Repeated
  1084.                                                 Binary
  1085.           Color         aux1  main1 aux2  main2 Pattern
  1086.           Black          00    00    00    00    0000
  1087.           Magenta        08    11    22    44    0001
  1088.           Brown          44    08    11    22    0010
  1089.           Orange         4C    19    33    66    0011
  1090.           Dark Green     22    44    08    11    0100
  1091.           Grey1          2A    55    2A    55    0101
  1092.           Green          66    4C    19    33    0110
  1093.           Yellow         6E    5D    3B    77    0111
  1094.           Dark Blue      11    22    44    08    1000
  1095.           Violet         19    33    66    4C    1001
  1096.           Grey2          55    2A    55    2A    1010
  1097.           Pink           5D    3B    77    6E    1011
  1098.           Medium Blue    33    66    4C    19    1100
  1099.           Light Blue     3B    77    6E    5D    1101
  1100.           Aqua           77    6E    5D    3B    1110
  1101.           White          7F    7F    7F    7F    1111
  1102.  
  1103.                    Table 2-The Sixteen Colors
  1104.  
  1105. In Table 2, the heading aux1 indicates the first, fifth, ninth, thirteenth, 
  1106. etc. byte of each line (i.e., every fourth byte, starting with the first 
  1107. byte).  The heading main1 indicates the second, sixth, tenth, fourteenth, etc. 
  1108. byte of each line (i.e., every fourth byte, starting with the second byte).  
  1109. The aux2 and main2 headings indicate every fourth byte, starting with the 
  1110. third and fourth bytes of each line, respectively.  Aux1 and aux2 are always 
  1111. stored in auxiliary memory, while main1 and main2 are always stored in the 
  1112. motherboard memory.
  1113.  
  1114. As you will infer from Table 2, the absolute position of a byte also 
  1115. determines the color displayed.  If you write an 8 into the first byte at the 
  1116. far left side of the screen (i.e., in the aux1 column), then a red dot is 
  1117. displayed.  But if you write an 8 into the third byte at the left side of the 
  1118. screen (the aux2 column), then a dark green dot is displayed.  Remember, the 
  1119. color monitor decides which color to display based on the relative position of 
  1120. the bits on each line (i.e., on how far the bits are from the left edge of the 
  1121. screen).
  1122.  
  1123. So far, so good.  But suppose you want to display more than one color on a 
  1124. single line.  It's easy:  just change the four-bit pattern that is stored in 
  1125. memory.  For example, if you want the left half of the line to be red, and the 
  1126. right half to be purple, then store the red pattern (8, 11, 22, 44) in the 
  1127. first 40 bytes of the line, then store the purple pattern (19, 33, 66, 4C) in 
  1128. the second 40 bytes of the line.  Table 2 is a useful reference tool for 
  1129. switching from one color to another, provided you make the change on a byte 
  1130. boundary.  In other words, you must start a new color at the same point in the 
  1131. pattern at which the old color ended.  For example, if the old color stops 
  1132. after you write a byte from the main1 column, then you should start the new 
  1133. color by storing the next byte in memory with a byte from the aux2 column.  
  1134. This procedure is illustrated below:
  1135.  
  1136. 2028:11 44 11 44 11 44 11 77 5D 77 5D 77 5D    (creates a dashed line
  1137. 2128: 8 22 8 22 8 22 8 22 6E 3B 6E 3B 6E       that is red then yellow)
  1138.  
  1139. 2028<2128.2134^Y                               (fills in the rest of 
  1140.                                                the colors)
  1141.  
  1142.  
  1143. Switching Colors in Mid-Byte
  1144.  
  1145. If you want a line to change color in the middle of a byte, you will have to 
  1146. recalculate the column, based on the information in Table 2.  Suppose you want 
  1147. to divide the screen into three vertical sections, each a different color.  
  1148. The leftmost third of the screen ends in the middle of the 27th character from 
  1149. the left edge-that is, in an aux2 column of the color table.  (Dividing 27 by 
  1150. 4 gives a remainder of 3, which indicates the third column, or aux2.)  Your 
  1151. pattern should change from the first color to the second color after the 5th 
  1152. bit of the 27th byte.  You can change the color in the middle of a byte by 
  1153. selecting the appropriate bytes from the aux2 column of Table 2 and 
  1154. concatenating two bits for the second color with five bits for the first 
  1155. color.
  1156.  
  1157. However, because the bits from each byte are shifted out in order from least 
  1158. significant to most significant, the two most significant bits (in this case 
  1159. bits 5 and 6, because bit 7 is unused) for the second color are concatenated 
  1160. with the five least significant bits for the first color.  For instance, if 
  1161. you want the color to change from orange (the first color) to green (the 
  1162. second color), then you must append the two most significant bits (5 and 6) of 
  1163. green to the five least significant bits (0-4) of orange.  In Table 2, the 
  1164. aux2 column byte for green is 19, and the two most significant bits are both 
  1165. clear.  The aux2 column byte for orange is 33, and the five least significant 
  1166. bits are equal to 10011.  The new byte calculated from appending green (00) to 
  1167. orange (10011) yields 13 (0010011).  Therefore, the first 26 bytes of the line 
  1168. come from the table values for orange; the 27th byte is 13, and the next 26 
  1169. bytes come from the table values for green.
  1170.  
  1171.      2300: 19 66                      (puts an orange line on the 
  1172.                                       screen)
  1173.      2302<2300.2310M
  1174.      2350: 4C 33
  1175.      2352<2350.2360M
  1176.      2300<2350.2360^Y
  1177.  
  1178.      230D: 33 4C 33 4C 33 4C 33 4C    (puts a green line next to it)
  1179.      235D: 13 66 19 66 19 66 19 66    (note the first byte)
  1180.      230D<235D.2363^Y
  1181.  
  1182. There you have it:  a basic explanation of how double hi-res works--except for 
  1183. one or two anomalies.  The first anomaly is that NTSC monitors have a limited 
  1184. display range.  The second anomaly shows one of the features of double hi-res 
  1185. versus a limitation of standard hi-res.
  1186.  
  1187. An NTSC color monitor decides what color to display based on its view of four 
  1188. bit windows in each line, starting from the left edge of the screen.  The 
  1189. monitor looks at the first four bits, determines which color is called for, 
  1190. then shifts one bit to the right and determines the color for this new four-
  1191. bit window.  But remember, the color depends not only on the pattern, but also 
  1192. the position of the pattern.  To compensate for relative position from the 
  1193. left edge of the screen, the monitor keeps track of where on each line each of 
  1194. these windows start.  (For those of you of the technical persuasion, this is 
  1195. done through the use of the color burst signal, which is a 3.58 MHz. clock).
  1196.  
  1197. Try this example:
  1198.  
  1199.      2000:0              Clears the screen
  1200.      2001<2000.3FFFM
  1201.      2000<2000.3FFF^Y
  1202.  
  1203.      2001:66             Draws an orange box in the upper left
  1204.      2401:66
  1205.      2801:66
  1206.      2C01:66
  1207.      3001:66
  1208.  
  1209.      2050:33             Draws a blue box below and to the right
  1210.      3402<2050.2050^Y    of the orange box
  1211.      3802<2050.2050^Y
  1212.      3C02<2050.2050^Y
  1213.  
  1214. Notice that if the blue box was drawn at the top of the screen, next to the 
  1215. orange box, they would overlap.  Yet, the boxes were drawn on two different 
  1216. columns, orange on main2 and blue on aux1.  This can be explained by the 
  1217. previous paragraph, and the sliding windows.  The monitor will detect the 
  1218. pattern for orange slightly after the main2 column, while the pattern for blue 
  1219. shows up before column aux1.
  1220.  
  1221. The orange pattern is as follows:
  1222.  
  1223.      0000000 | 0110011 |0000000    look at four-bit windows and you will see
  1224.         aux2 |   main2 |   aux1    an orange pattern overlaps on both sides
  1225.  
  1226. If a pattern is repeated on a line, this overlap does not cause a problem, 
  1227. since the same color just overlaps itself.  But watch what happens when a new 
  1228. pattern is started next to a different pattern:
  1229.  
  1230.      3002<2050.2050^Y    Puts a blue pattern next to the orange one
  1231.      2C02<2050.2050^Y
  1232.      2802<2050.2050^Y
  1233.  
  1234. Where the blue overlaps the orange, you will see a white dot.  This effect is 
  1235. because one of the four-bit windows the monitor sees is all 1s.  If two colors 
  1236. are placed right next to each other, the monitor will sometimes display a 
  1237. third color, or fringe, at the boundary.  This fringe effect is especially 
  1238. noticeable when there are a lot of narrow columns of different colors next to 
  1239. each other.  (Next time you run COLOR TEST take a look at the boundaries 
  1240. between the colors).
  1241.  
  1242. The orange and blue patter is as follows:
  1243.  
  1244.      0000000 |0110011 | 11001100    note the four 1s in a row at the boundary
  1245.         aux2 |  main2 |     aux1    between orange and blue
  1246.  
  1247.  
  1248. Conclusion
  1249.  
  1250. Now you have the tools and the rules to the double hi-res mode.  As you can 
  1251. see, double hi-res has more color with higher resolution than standard hi-res.  
  1252. You can even develop games that do fancy animation or scroll orange objects 
  1253. across green backgrounds.  You can develop word processing programs which use 
  1254. different fonts or proportional character sets in black and white.  Have fun 
  1255. playing with his new mode.
  1256.  
  1257.  
  1258. Further Reference
  1259.     o    Apple IIe Technical Reference Manual
  1260.     o    Apple IIc Technical Reference Manual, Second Edition
  1261.     o    Apple IIGS Hardware Reference
  1262.